#ifndef TempConfigH
 #define TempConfigH

 #include "CPU_const.h"

void INIT_RAM(void);
//uint putRAM(usht adr, uint nbyte, char *pSource);
usht * getRAM(usht adr, char nReg);



//extern char DataTime[];
extern usht Query[], MyID, IBatGrand, EBatGrand, Alarms, GSMstat, AOUT1, AOUT2, TmeasSec, TtransSec, RTouts, PwrMode, GSM_ETH; 
extern short TempGrand;
extern uint EnergySEB, AVservEK270, AVstanEK270;  
extern int AIN[];
extern float PowerSEB, TempEK270, PresEK270, VFRservEK270, VFRstanEK270;








/****************************************************************************************************/
/*                                D I F F E R E N T     M A C R O S                                 */
/****************************************************************************************************/
#define CELL_SET(A)   ( Cell_set(a##A, n##A, &##A, f##A) )
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/




/****************************************************************************************************/
/*                             D I F F E R E N T    C O N S T A N T S                               */
/****************************************************************************************************/
  #define OnlyRD        ( 0<<0 )          //Only read
  #define OnlyWR        ( 1<<0 )          //Only write to registers
  #define Qask          ( 1<<1 )          // 
  #define DTset         ( 1<<2 )          //
  #define OUTset        ( 1<<3 )          //
  #define PMset         ( 1<<4 )          //
//  #define SetADR        ( 1<<5 )          //Managment & Station Register after write to register
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*                    G R A N D E N E R G O   S T R U C T U R E   M O D B U S                       */
/*                               A D D R E S S   C O N S T A N T S                                  */
/****************************************************************************************************/
  #define aQuery          0        //
  #define aMyID           2        //
  #define aDataTime       3        //
  #define aTempGrand      6        //
  #define aIBatGrand      7        //
  #define aEBatGrand      8        //
  #define aAlarms         9        //
  #define aAIN            10       //
  #define aGSMstat        22       //
  #define aPowerSEB       23       //
  #define aEnergySEB      25       //
  #define aTempEK270      27       //
  #define aPresEK270      29       //
  #define aVFRservEK270   31       //
  #define aVFRstanEK270   33       //
  #define aAVservEK270    35       //
  #define aAVstanEK270    37       //
  #define aRTouts         39       //
  #define aAOUT1          40       //
  #define aAOUT2          40       //
  #define aTmeasSec       42       //
  #define aTtransSec      43       //
  #define aPwrMode        44       //
  #define aGSM_ETH        45       //
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/

/****************************************************************************************************/
/*                    G R A N D E N E R G O   S T R U C T U R E   M O D B U S                       */
/*                       N U M B E R   O F    B Y T E S   C O N S T A N T S                         */
/****************************************************************************************************/
  #define nQuery          2//4        //
  #define nMyID           1//2        //
  #define nDataTime       3//6        //
  #define nTempGrand      1//2        //
  #define nIBatGrand      1//2        //
  #define nEBatGrand      1//2        //
  #define nAlarms         1//2        //
  #define nAIN            12//24       //
  #define nGSMstat        1//2        //
  #define nPowerSEB       2//4        //
  #define nEnergySEB      2//4        //
  #define nTempEK270      2//4        //
  #define nPresEK270      2//4        //
  #define nVFRservEK270   2//4        //
  #define nVFRstanEK270   2//4        //
  #define nAVservEK270    2//4        //
  #define nAVstanEK270    2//4        //
  #define nRTouts         1//2        //
  #define nAOUT1          1//2        //
  #define nAOUT2          1//2        //
  #define nTmeasSec       1//2        //
  #define nTtransSec      1//2        //
  #define nPwrMode        1//2        //
  #define nGSM_ETH        1//2        //
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*                    G R A N D E N E R G O   S T R U C T U R E   M O D B U S                       */
/*                  O P E R A T I O N   T Y P E   F L A G S   C O N S T A N T S                     */
/****************************************************************************************************/
  #define fQuery         ( Qask   )      //
  #define fMyID          ( OnlyRD )      //
  #define fDataTime      ( DTset  )      //
  #define fTempGrand     ( OnlyRD )      //
  #define fIBatGrand     ( OnlyRD )      //
  #define fEBatGrand     ( OnlyRD )      //
  #define fAlarms        ( OnlyRD )      //
  #define fAIN           ( OnlyRD )      //
  #define fGSMstat       ( OnlyRD )      //
  #define fPowerSEB      ( OnlyRD )      //
  #define fEnergySEB     ( OnlyRD )      //
  #define fTempEK270     ( OnlyRD )      //
  #define fPresEK270     ( OnlyRD )      //
  #define fVFRservEK270  ( OnlyRD )      //
  #define fVFRstanEK270  ( OnlyRD )      //
  #define fAVservEK270   ( OnlyRD )      //
  #define fAVstanEK270   ( OnlyRD )      //
  #define fRTouts        ( OUTset )      //
  #define fAOUT1         ( OUTset )      //
  #define fAOUT2         ( OUTset )      //
  #define fTmeasSec      ( OnlyWR )      //
  #define fTtransSec     ( OnlyWR )      //
  #define fPwrMode       ( PMset  )      //
  #define fGSM_ETH       ( OnlyWR  )      //
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



#endif